package com.bjtu.ptsite.config;

import com.bjtu.ptsite.tracker.service.LoggingTrackedTorrentService;
import com.bjtu.ptsite.utils.RedisUtil;
import com.turn.ttorrent.client.SharedTorrent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.File;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;

/**
 *
 * @author Zehao Wang, Junjie Zhang, Yutao Wei
 *
 */
@Configuration
public class TorrentServiceConfig {

    @Autowired
    private RedisUtil redisUtil;

//    @Bean
//    public LoggingTrackedTorrentService loggingTrackedTorrentService() throws IOException, NoSuchAlgorithmException, IOException, NoSuchAlgorithmException {
//        SharedTorrent sharedTorrent = SharedTorrent.fromFile(new File("your-torrent-file.torrent"));
//        LoggingTrackedTorrentService service = new LoggingTrackedTorrentService(sharedTorrent);
//        service.setRedisUtil(redisUtil);
//        return service;
//    }
}
